package com.sweet.controller;

import com.sweet.Result;
import com.sweet.dto.CommonDto;
import com.sweet.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private IOrderService orderService;

    @GetMapping("/consumer/of/orders")
    public Result getList(CommonDto dto) {
        if (dto.getCurPage() == null) {
            dto.setCurPage(1);
        }
        if (dto.getPageSize() == null) {
            dto.setPageSize(10);
        }
        return orderService.getList(dto.getCurPage(), dto.getPageSize());
    }

    @GetMapping(value = "/consumer/payment/lb")
    public String getPaymentLB(){
        return orderService.getPaymentLB();
    }
}
